import React from 'react'
import { Navigate } from 'react-router-dom'

function UToke(Compon:any) {
    const token = localStorage.getItem("token")
    if(token){
        return Compon
    }else{
        return () => {<Navigate to={'/login'}/>}
    }
    }

export default UToke
